1. Field of the Invention
The present invention relates to an image processing method and apparatus such as a copier, provided with functions of inputting and outputting an image, and in addition, capable of subjecting an inputted image to a predetermined process and outputting the image.
2. Description of the Related Art
In a digital copier which reads and outputs an image, the following well-known techniques are used: a technique of synthesizing a plurality of documents into a single document and outputting the single document; and an inserting and synthesizing technique of subjecting a masking process to an arbitrarily predetermined region of a document and thereby inserting another document into the document. Such a synthesizing technique as mentioned above is described in Japanese Unexamined Patent Publication JP-A 5-145735 (1993), for example. In this prior art, the user operates operating means such as an edit pad to set a trim region in an image from which trim region an image is extracted. The extracted image is inserted into a mask region in another image which is a base image, to be synthesized. By adding a twist to a method of specifying a mask region, it is possible to eliminate an unnecessary image region from an extracted image.
JP-A 5-145735 discloses elimination of an unnecessary image region by specifying a mask region. However, in the case of, for example, a hand-written note which is overwritten on a printed matter, it is difficult to definitely separate the note as a mask region, so that it is difficult to eliminate the note only by adding a twist to a method of specifying a mask region. Moreover, since it is necessary to prepare a display device and a terminal device such as operating means so that the user can specify a mask region, the overall apparatus tends to be upsized, and it gets hard to use the apparatus with ease.
Further, Japanese Unexamined Patent Publication JP-A 63-163678 (1988) discloses an automatic image checking apparatus for checking images of two objects, e.g., prints of seals. The automatic image checking apparatus extracts checking objects from the respective images on the basis of a portion common to the images of the two objects, and executes a checking process on the basis of the checking objects extracted from the respective images. At the time of extracting the checking objects, after the images of the two objects are mutually registered, an initial mask pattern is formed by considering a pixel density value of 1 or more to be 1 in the respective images while ANDing both the images, and a final mask pattern is generated by expanding the initial mask pattern. The images of the two objects are subjected to masking, respectively, by using the final mask pattern, with the result that the checking objects of the respective images are extracted. In JP-A 63-163678, a pixel density value of 1 or more is replaced with 1, so that the difference in density values of pixels, each of which has a pixel density value of 1 or more, is not reflected on extraction of a portion common to images of two objects therefrom.
Furthermore, Japanese Unexamined Patent Publication JP-A 5-231837 (1993) discloses a shape measuring method for working out the shape of a soldered part which is given to an electronic component on a packing board. In the shape measuring method, an angle of illumination to the soldered part given to the electronic component on the packing board is sequentially changed. At every predetermined angle, regular reflection light from the soldered part is picked up. For the purpose of eliminating an image of wiring or the like which is common to both images, data of the images shot at every predetermined angle are subjected to a process of subtracting one from the other. On the basis of data of the images obtained in the subtracting process, the three-dimensional shape of the soldered part is worked out. In JP-A 5-231837, the data of the images is subjected to a process of subtracting for each pixel as it is, so that the magnitude of the difference in pixel values is not reflected on elimination of an image common to both images.
An object of the invention is to provide an image processing method and apparatus capable of carrying out image processing such as elimination of an unnecessary portion, with a simple operation.
The invention provides an image processing apparatus comprising at least:
input means for carrying out a distribution process of image information inputted through an image input mechanism;
storing means for storing an image inputted through the input means;
comparing means for comparing an image inputted through the input means with an image stored in the storing means; and
output means for outputting a result of comparison by the comparing means,
wherein the comparing means includes calculating means for calculating a difference in pixel values which represent pixel densities, between an image newly inputted through the input means and an image stored in the storing means, and recognizing means for recognizing a portion common to images by comparing an output of the calculating means with a preset threshold value.
According to the invention, image information inputted through the input means is stored in the storing means, and an image newly inputted through the input means is compared with the image stored in the storing means, by the comparing means. The comparing means includes the calculating means for calculating the difference in pixel values, which represent pixel densities, between a newly inputted image and the stored image, and the recognizing means for recognizing a portion common to the images by comparing an output of the calculating means with a threshold value, so that only by sequentially inputting image information into the input means, image processing based on recognition of a portion common to the images can be carried out.
As shown above, according to the invention, the comparing means compares an image newly inputted to the input means with an image stored in the storing means, and a comparison result is outputted from the output means. In the comparing means, the calculating means calculates the difference in pixel values between the image inputted through the input means and the image stored in the storing means, and the recognizing means recognizes a portion common to the images by comparing an output of the calculating means with a threshold value. A result of comparison by the comparing means contains a result of recognition of the portion common to the images by the recognizing means, so that only by inputting images, the user is capable of obtaining a result of image processing based on the portion common to the images.
Further, in the invention it is preferable that:
at least three or more kinds of image information are sequentially inputted into the input means;
the output means sequentially replaces an image stored in the storing means with an image outputted from the comparing means after each input of one of the kinds of images and prior to the next sequential input of another of the kinds of images; and
the recognizing means recognizes a portion common to an image newly inputted through the input means and the image stored in the storing means by comparing the images.
According to the invention, while sequentially inputting three or more kinds of images, the user is capable of making the apparatus sequentially carry out image processing based on recognition of a portion common to an image inputted immediately before and a newly inputted image and extract the common portion in a reliable manner. As shown above, according to the invention, while sequentially inputting at least three or more kinds of image information, the user is capable of making the apparatus recognize a common portion and sequentially carry out image processing based on a result of recognition of the common portion.
Still further, in the invention it is preferable that the comparing means includes extracting means for causing the output means to output only a pixel of which the difference in pixel values calculated by the calculating means is equal to or less than the threshold value.
According to the invention, extracting means included in the comparing means causes the output means to output only a pixel of which the difference in pixel values calculated by the calculating means is equal to or less than the threshold value, so that it is possible to make the apparatus output as an image, only a common portion in which the difference in pixel values is equal to or less than the threshold value. As shown above, according to the invention, the calculating means calculates the difference in pixel values, and the extracting means causes the output means to output only a pixel of which the difference in pixel values is equal to or less than the threshold value, so that it is possible to make the apparatus output as an image, only a common portion in which the difference in pixel values is smaller than the threshold value.
Still further, in the invention it is preferable that the comparing means includes eliminating means for causing, when the difference in pixel values calculated by the calculating means is equal to or less than the threshold value, the output means to output the inputted image and the stored image as two images, while preventing a pixel of which the difference in pixel values is equal to or less than the threshold value, from being outputted into the respective images.
According to the invention, the comparing means includes the eliminating means, so that when the difference in pixel values calculated by the calculating means is equal to or less than the threshold value, it is possible to make the apparatus eliminate a common portion in which the difference in pixel values is equal to or less than the threshold value, from an inputted image and a stored image, and output both the images. As shown above, according to the invention, the image processing apparatus can output an inputted image and a stored image from the output means, respectively, when the difference in pixel values is equal to or less than the threshold value, so that the apparatus can output the images from which a common portion is eliminated in a simple manner.
Still further, in the invention it is preferable that the comparing means includes extracting means for causing the output means to output only a pixel of which the difference in pixel values calculated by the calculating means is equal to or less than the threshold value, and eliminating means for causing, when the difference in pixel values calculated by the calculating means is equal to or less than the threshold value, the output means to output the inputted image and the stored image as two images, while preventing a pixel of which the difference in pixel values is equal to or less than the threshold value, from being outputted thereinto.
The apparatus further comprises selecting means for selecting one of the extracting means and the eliminating means, which are included in the comparing means, to be put into operation.
According to the invention, the user can select through the selecting means, either extracting a common portion in which the difference in pixel values is equal to or less than the threshold value by the extracting means and outputting the common portion, or eliminating the common portion by the eliminating means and outputting images. As shown above, according to the invention, the apparatus is equipped with both a facility to extract a common portion from images to output the common portion as an image and a facility to eliminate a common portion from images to output the images, and capable of activating both the facilities selectively.
Still further, an image processing apparatus of the invention further comprises setting means for allowing the user to set the threshold value.
According to the invention, the image processing apparatus is equipped with the setting means for allowing the user to set a threshold value used in comparison of the differences in pixel values between the inputted image and the stored image in recognizing a portion common to the images by the recognizing means included in the comparing means, so that the user is capable of arbitrarily setting a level of the difference in pixel values which is recognized as a common portion, and making the apparatus recognize a common portion properly in accordance with the density of an inputted image and carry out image processing with a recognition result reflected. As shown above, according to the invention, the user is capable of using the setting means to set a threshold value used for comparing the difference in pixel values, so that the user is capable of setting an allowable range of the difference in pixel values between images which is recognized as a common portion, and regulating a status of recognizing a common portion in accordance with the density of an image to be processed.